const limitLoad = (imgUrls, handler, limit) => {
  const urls = imgUrls;

  const promises = imgUrls.splice(limit).map((item, index) => {
    return handler(item, index);
  });

  const curp = Promise.race(promises);
  // promises.push(imgUrls[])
};

const handler = (img, index) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log("cur img index", img);
      resolve(img, index);
    }, Math.random() * 10 * 1000);
  });
};
